package com.example.thirdhomework

import android.app.Activity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import androidx.appcompat.app.AppCompatActivity

class SecondActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)

        val editText = findViewById<EditText>(R.id.editText)
        findViewById<Button>(R.id.confirmButton).setOnClickListener {
            val intent = intent
            intent.putExtra("result", editText.text.toString())
            setResult(Activity.RESULT_OK, intent)
            finish()
        }
    }
}
